package com.xiong.selenium;

import com.xiong.selenium.chrome.ChromeModel;
import com.xiong.selenium.edge.EdgeModel;
import com.xiong.selenium.util.WebDriverUtil;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.edge.EdgeDriver;

public class Test {

    public static void main(String[] args) {
        EdgeModel edgeModel=new EdgeModel();
        edgeModel.openUrl("https://www.baidu.com/").windowFull();
        edgeModel.sleep(200);
        edgeModel.inputElementById("kw","三大队");
        edgeModel.sleep(1000);
        edgeModel.clickEnter();
        edgeModel.sleep(1000);
        edgeModel.dealOther(webDriver ->{
            WebElement webElement=WebDriverUtil.getWebElementById(webDriver,"content_left");
            String html=WebDriverUtil.getWebElementHtmlCode(webElement);
            System.out.println(html);
        });
        edgeModel.windowScrollToBottom();
    }

    @org.junit.Test()
    public void qiaopiao(){
        EdgeModel edgeModel=new EdgeModel();
        edgeModel.openUrl("https://www.12306.cn/index/");
        edgeModel.addCookie("JSESSIONID","5E84703F1065A756917A88806D59F84D");
        edgeModel.refresh();
        System.out.println(edgeModel.getElementHtmlCode());
    }
}
